<?php
$get_url=$_SERVER['HTTP_HOST'];
$m_url=explode(".","$get_url");
$m_url1=$m_url[0];
$m_url2=$m_url[1].".".$m_url[2];
if($m_url2=="sandib2b.cn"){
   $m_rs=@mysql_query("select * from member where m_user='$m_url1' and m_type=6 and m_sh=1");
   $m_rs2=@mysql_query("select count(id) from member where m_user='$m_url1' and m_type=6 and m_sh=1");
   $m_num=@mysql_result($m_rs2,0);
     if($m_num){
	     $m_row=@mysql_fetch_array($m_rs);
		 $member_id=$m_row[id];
	     $template=$m_row[template];
	  }else{
       echo "<script>location='http://www.sandib2b.cn/cn/template/$m_url1/';</script>";
	  }

}else{
echo "<script>location='error.htm';</script>";
}
?>